<?php
/**
 * Defines the CoursePage page type
 */
class CoursePage extends Page {
    static $db = array(
        'Name' => 'Text',
        'Holes' => 'Int',
        'Par' => 'Int',
        'LengthMeters' => 'Int',
        'LengthYards' => 'Int',
        'YearOpened' => 'Int',
        'TargetType' => 'Text',
        'TeeType' => 'Text',
        'Comment' => 'Text',
        'AddedBy' => 'Int',
        'AddedDate' => 'Datetime',
        'ModifiedBy' => 'Int',
        'ModifiedDate' => 'Datetime'
    );
    static $has_one = array(
    );

    function getCMSFields() {
        $fields = parent::getCMSFields();

        $fields->addFieldToTab('Root.Content.Main', new TextField('Name'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new NumericField('Holes'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new NumericField('Par'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new NumericField('LengthMeters'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new NumericField('LengthYards'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new NumericField('YearOpened'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextField('TargetType'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextField('TeeType'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new TextareaField('Comment'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new HiddenField('AddedBy'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new HiddenField('AddedDate'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new HiddenField('ModifiedBy'), 'Content');
        $fields->addFieldToTab('Root.Content.Main', new HiddenField('ModifiedDate'), 'Content');

        return $fields;
    }
}

class CoursePage_Controller extends Page_Controller {
    
}
?>
